package com.zbkj.service.service.user;

import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import com.zbkj.common.model.user.User;
import com.zbkj.common.model.user.UserBill;
import com.zbkj.common.request.user.AdminClientUserRequest;
import com.zbkj.common.request.user.AdminUserQueryRequest;
import com.zbkj.common.vo.user.UserDatavalVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 客户端用户表 服务类
 * </p>
 *
 * @author
 * @since 2024-07-05
 */
public interface UserService extends IService<User> {

    PageInfo<User> adminGetList(AdminUserQueryRequest queryRequest);

    /**
     * 登录账户名重复检查
     * @param id
     * @param account
     */
    boolean accountRepeatCheck(Long id, String account);

    /**
     * 用户信息新增|编辑保存
     * @param user
     */
    boolean userSaveOrUpdate(User user);

    /**
     * 更新客户端用户信息
     * @param user
     * @return
     */
    boolean updateUserInfo(User user);

    User getLoginUserInfo();

    User getUserByAccount(String account);

    User getUserById(Long id);

    User getUserInfoCache(Long id);

    void saveUserInCache(User user);

    void delUserCache(Long id);

    /**
     * 用户有效检查
     * @param user
     */
    void userValidCheck(User user);

    boolean deductDataval(UserDatavalVo userDatavalVo, List<UserBill> userBillList);

    boolean incrDataval(UserDatavalVo userDatavalVo, List<UserBill> userBillList);

    void userCardExpireHandle(User user);

    boolean icrDataValAndCheckCardId(long userId, Long cardDataval, Long dataval, Long cardId);

    List<User> getUsersByIds(List<Long> userIds);

    /**
     * 判断是否是否是年卡会员
     * @param id
     * @return
     */
    boolean getYearUserFlag(Long id);
}
